argument1=$1 #node name
argument2=$2 #observation count
argument3=$3 #gridsize
argument4=$4 #rest seconds between moves
argument5=$5 #max nodes per
argument6=$6 #rmi address
argument7=$7 #port
argument8=$8 #instrument =1 or 0
echo "hello world"
exprans=`expr $5 - 1`
echo $exprans
for ((  i = 0 ;  i < argument5;  i++  ))
do
   echo $i
   if [ $i -eq $exprans ]
   then
       echo "last item"
          java com/swe727/spring2011/constraint1/client/NodeController node"$i" $2 $3 $4 $5 $6 $7 1 &
   else
       echo "not last item"
          java com/swe727/spring2011/constraint1/client/NodeController node"$i" $2 $3 $4 $5 $6 $7 0 &
   fi
   sleep 2s
done 
